package com.example.myapplication;

import androidx.room.Database;
import androidx.room.RoomDatabase;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;

@Database(entities = {Movie.class}, version = 2) // 更新版本号
public abstract  class MovieDatabase extends RoomDatabase {
    public abstract MovieDao movieDao();

    static final Migration MIGRATION_1_2 = new Migration(1, 2) {
        @Override
        public void migrate(SupportSQLiteDatabase database) {
            // 添加迁移步骤，例如添加新的列
            database.execSQL("ALTER TABLE Movie ADD COLUMN poster_path INTEGER");
        }
    };
}
